package com.example.viewpageapplication;

import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        ViewPager viewPager = findViewById(R.id.vp_main);
        //将xml文件实例化为view对象
        LayoutInflater layoutInflater = getLayoutInflater();

//        View fist = layoutInflater.inflate(R.layout.first_page);
//        View second = layoutInflater.inflate(R.layout.second_page);
//        View third = layoutInflater.inflate(R.layout.third_page);

//        List<View> list = new ArrayList<>();
//        list.add(fist);
//        list.add(second);
//        list.add(third);


    }
}